<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="css/styles.css">
  <title>${title}</title>
</head>
<body>
	<c:if test="${not empty errorMessage}">
	  <h2 class=error>${errorMessage}</h2>
	</c:if>
  <form action="${actionURL}" method="post">
	  <table>
	    <tbody>
	      <tr>
	        <th>Email des Kunden:</th>
	        <td>
	           <input type="hidden" name="${kundenFields.ID}" value="${Kunde.id}"/>
	           <input type="text" maxlength="20" name="${kundenFields.EMAIL}" value="${Kunde.EMAIL}"/>	           
	        </td>
	      </tr>
	      <tr>
	        <th>Anrede des Kunden:</th>
	       <td>
	       	<c:choose>
	       	 <c:when test="${Kunde.ANREDE eq 'Herr'}">
	       		<input type="radio" maxlength="0" name="${kundenFields.ANREDE}" value="Herr" checked="checked"/>Herr
	       		<input type="radio" maxlength="0" name="${kundenFields.ANREDE}" value="Frau"/>Frau
	       	</c:when>	
	       	 <c:otherwise>
	       	 	<input type="radio" maxlength="0" name="${kundenFields.ANREDE}" value="Herr" />Herr
	       		<input type="radio" maxlength="0" name="${kundenFields.ANREDE}" value="Frau" checked="checked"/>Frau
	       	 </c:otherwise>	       	
	       	 </c:choose>
	       </td>
	      </tr>
	      <tr>
	     
	        <th>Name des Kunden:</th>
	        <td><input type="text" maxlength="30" name="${kundenFields.NAME}" value="${Kunde.NAME}"/></td>
	      </tr>
	       <tr>
	        <th>Passwort des Kunden:</th>
	        <td><input type="password" maxlength="30" name="${kundenFields.PASSWORT}" value="${Kunde.PASSWORT}"/></td>
	      </tr>
	      <tr>
	        <th>Strasse des Kunden:</th>
	        <td><input type="text" maxlength="20" name="${kundenFields.STRASSE}" value="${Kunde.STRASSE}"/></td>
	      </tr>
	      <tr>
	      	<th>Plz und Ort:</th>
	      	<td><select name="mapPlzID">		     
			   <c:forEach var="mapPlz" items="${mapPlz}">
			   <c:choose>
			   <c:when test="${mapPlz.key eq Kunde.plzId}">
			   		<option selected="selected" value="${mapPlz.key}">${mapPlz.value}</option>
			   </c:when>
			   <c:otherwise>
			   		<option value="${mapPlz.key}">${mapPlz.value}</option>
			   </c:otherwise>		
			   </c:choose>		
			   </c:forEach> 
			   </select> 
			</td>    
	      </tr>
	      <tr>
	        <td colspan="2" align="right"><input type="submit" name="submit" value="speichern"/>
	        <td colspan="2" align="right"><input type="submit" name="back" value="zur&uuml;ck"/>
	      </tr>
	    </tbody>
	  </table>
  </form>
</body>
</html>